<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            height: 0;
        }

        body {

            height: 2000px;
            position: relative;
        }

        main {
            display: block;
            box-sizing: border-box;
            width: 1200px;
            height: 418px;
            /* border: 1px solid red; */
        }

        main img {
            width: 1200px;
            height: 409px;
        }

        .return_div {
           
            position: fixed;
            top: 70%;
            right: 20px;
            width: 80px;
            display: none;
            text-align: center;
            font-size: 80px;
            height: 80px;
            line-height: 100px;
            color: white;
            /* border: 1px solid red; */
            background: rgba(0, 0, 0, 0.5);
            cursor: pointer;
        }
    </style>
</head>

<body>
    <main>
        <img src="./img/网易1.png" alt="">
    </main>

    <div class="return_div">
        ^
    </div>
    <script src="animate.js"></script>
    <script>
        var aReturn = document.querySelector(".return_div");

        window.onscroll = function(){
            var scroll =  document.documentElement.scrollTop || document.body.scrollTop;
            if(scroll >=200){
                aReturn.style.display = "block";
            } else {
                aReturn.style.display = "none";
            }
        }
        aReturn.onclick = function(){
            // document.documentElement.scrollTop = 0;
            animate(document,0);
         
        }

    </script>
</body>

</html>